import  {  type Request, type Response } from "express"
import { ReturnData } from "../../interface/interface"
import { CODE } from "../../utils/const"

export const getErr = (err: string = "server internal error", errCode: CODE = CODE.serverException) => {
    let obj: ReturnData< any > = {
        code: errCode,
        meg: err
    }
    return obj
}


export  function getResult<T>( result: T ){
    let obj: ReturnData< T > = {
        code: CODE.successCode,
        data: result
    }
    return obj
}